/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function showHidePopup(id,value) {
    if (value == 'none') {
        document.getElementById('tendangnhap').value = "";
        document.getElementById('matkhau').value = "";

    }
    document.getElementById(id).style.display = value;
    document.getElementById('backgroundFrame').style.display =  value;
    if (id == 'dangnhapFormPopup') {
        document.getElementById('tendangnhap').focus();
    } else if (id == 'dangkiFormPopup') {
        document.getElementById('username').focus();
    }
}
function changeBg(pos) {
    var color = "";
    if (pos == 'over') {
        color = '#47433F';
    } else {
        color = '#6D6969';
    }
    document.getElementById('submit').style.backgroundColor = color;
}
function login() {
    username = document.getElementById("tendangnhap").value;
    password = document.getElementById("matkhau").value;
    msg = "";
    valid = true;

    if (username == "") {
        document.getElementById("tendangnhapValid").value = "Vui lòng nhập tên đăng nhập!";
        document.getElementById("tendangnhapValid").style.visibility="visible";
        valid = false;
    } else {
        document.getElementById("tendangnhapValid").style.visibility="hidden";
    }
    if (password == "") {
        document.getElementById("matkhauValid").value = "Vui lòng nhập mật khẩu!\n";
        document.getElementById("matkhauValid").style.visibility="visible";
        valid = false;
    } else {
        document.getElementById("matkhauValid").style.visibility="hidden";
    }
    return valid;
}
function clearThongTin(formName) {
    if ('dangnhapFormPopup' == formName) {
        document.getElementById("tendangnhapValid").style.visibility="hidden";
        document.getElementById("matkhauValid").style.visibility="hidden";
    }
}